<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        html   <input @click='infonow'  type="checkbox" value="html" v-model='checkarr'>
       vue  <input @click='infonow'  type="checkbox" value="vue" v-model='checkarr'>
       mongodb   <input @click='infonow'  type="checkbox" value="mongodb" v-model='checkarr'>

       <div>
           <button @click='a'>点击查看选中状态</button>
       </div>
    </div>


    <script>
   
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue22222!',
                checkarr:[]
            },
            methods:{
                a() {
                    alert(this.checkarr)
                },
                infonow() {
                    // vue内部算法双向数据绑定需要时间   内部算法 包了一个微任务  
                    setTimeout(() => {
                        console.log(this.checkarr)
                    }, 0);
                }
            }
        })

        console.log('app', app)

    </script>
</body>

</html>